package unidad4;

public class MyPassword {

	public static void main(String[] args)throws Exception {
		
		boolean bPass = false;
		int iCounter = 0;

		while ((bPass == false)&&(iCounter != 3)){

			char c1 = (char)System.in.read();
			char c2 = (char)System.in.read();
			char c3 = (char)System.in.read();
			char c4 = (char)System.in.read();
			char c5 = (char)System.in.read();

			if((c1 == 'c')&&(c2 == 'i')&&(c3 == 's')&&(c4 == 'c')&&(c5 == 'o')){

				System.out.println("The Password is Correct. Welcome User");
				bPass = true;
				//break;

			}else{

				iCounter++;
				System.out.println("The Password is incorrect. Do you want to try again");
			}
				
		}

		if (iCounter == 3){

			System.out.println("You exceed your limit");
			System.exit(0);

		}else{

			System.out.println("You're In!!");
		}
	}

}